#数字生成器，生成所有自然数
def number_generator():
    n=0;
    while True:
        n =n+ 1
        yield n

def number_filter(n):
    return lambda x:x%n>0

# n=2
# print(1)
# print(2)
# li=number_generator()
# while True:
#         li= filter(number_filter(n),li)
#
# for l in li:
#     print(l)

L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]
print(L[0][1])

#定义一个闭包，返回一个函数
def count():
    fs = []
    for i in range(1, 4):
        def f():
             return i*i
        fs.append(f)
    return fs

f1, f2, f3 = count()
#此时输出全为9，调用count时，内部方法并未执行，在返回方法时i的引用已变为3所以返回的都为9
print(f1())
print(f2())
print(f3())

for i in range(1,10):
    print(i,end=" ")

from enum import Enum
MONTH=Enum("Month",('Jan',"Feb","Mar"))